package com.itheima.exception;
/*全局异常处理器*/

import com.itheima.pojo.Result;
import  com.itheima.filter.fd;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(Exception.class)
    public Result ex(Exception exception) {
        exception.printStackTrace();
        System.out.println();
        return Result.error("对不起，操作失败");

    }

    public fd fp() {
        return fd.success(); // 返回一个 fd 对象
    }
}
